﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GameName1
{
    abstract class Projectile : GameObject, IHittable, IDisplayable, IMovable
    {
        protected Projectile(Vector2 position) : base(position)
        {
            
        }     

        public override void Update(GameTime gameTime)
        {
            Move();
        }

        protected abstract Texture2D Sprite { get; }
        public int DrawingOrder { get { return 0; } }
        public abstract void Draw(SpriteBatch spriteBatch);
    
        public abstract void HandleHit(IHittable other, GameTime colissionTime);
        public Rectangle GetCollisionBox()
        {
            return new Rectangle((int)Position.X, (int)Position.Y, Sprite.Width, Sprite.Height);
        }
        public virtual IEnumerable<Type> GetNotHittableTypes()
        {
            return new List<Type>();
        }

        public Vector2 Velocity { get; set; }
        public void Move()
        {
            Position += Velocity;
        }
    }
}
